package com.example.demo.spring;

/**
 * @author liweizhi
 * @date 2020/7/5
 */
public class ReflectTest {

    public static void main(String[] args) throws IllegalAccessException, InstantiationException {
        Class<Pet> clazz = Pet.class;
        Pet pet = clazz.newInstance();
        clazz.getFields();
        clazz.getDeclaredFields();
    }

    private static class Pet {
        String name;
        int age;
    }
}
